package com.ruoyi.auth.mq;

import com.ruoyi.auth.domain.SmsMessage;
import com.ruoyi.common.core.utils.SendSmsUtil;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SmsConsumer {
    @Autowired
    private SendSmsUtil sendSmsUtil;
    @RabbitListener(queues = "q1")
    public void receive(SmsMessage  smsMessage) {
        sendSmsUtil.sendSmsCode(smsMessage.getPhone(), smsMessage.getCode());
    }
}
